-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Dispose the certificate chain elements with the chain #62531
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Dispose the certificate chain elements with the chain #62531
Conversation
Gentle ping @halter73 |
cc @janvorli |
cc: @rzikm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, this is in line with what we do in SslStream
Note that this PR doesn't fix a "leak" per se. The cert instances will be eventually collected by GC and finalization will ensure the native resources are released. However, explicitly disposing the certs is definitely an improvement.
You may also want to dispose certificate at this callsite |
Yes, and no, for us the rate at which we do tls handshakes outpaces the rate of gc. Which leads to unbounded memory growth, until the gc collects aggressively, at which the application will health check and die. As in, yes you are correct this is not a native leak from the runtime, but it is effectively a managed leak with native resources which leads to the application degrading and restarting. cc @leculver |
Will address the comment. Can we take this into net8? |
😅 lol nice catch... |
Seems like this can be merged. cc @halter73 |
|
Dispose the certificate chain elements within the chain
This pr is going to fix a series of native memory leaks we have seen due to leaking certificates on the chain at Roblox. (fingers crossed)
Summary of the changes (Less than 80 chars)
Description
{Detail}
Fixes #{bug number} (in this specific format)